You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > Matrix Structure > Matrix Methods > Matrix.AddTensorProd Method
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
Matrix.AddTensorProd Method

Calculates the tensor product of two vectors and adds the result to calling matrix.

Syntax
C#
Visual Basic
public TMtx AddTensorProd([In] TVec Vec1, [In] TVec Vec2, bool ConjVec2);

Calculates the tensor product of Vec1 and Vec2 vectors and adds the result to the calling matrix by using the following formula: 

 

Y=Vec1 X Vec2 + Y.

 

If the ConjVec2 parameter is true, then the result will be tensor product of Vec1 and conjugated Vec2. The Rows property is set to Vec1.Length and Cols property is set to Vec2.Length. The Complex property of the calling matrix is adjusted automatically.

var a,b: Matrix; v1,v2: Vector; begin // Test non quadratic general matrix a.SetIt(2,2,False,[0,2,2,0]); v1.SetIt(false,[1,0]); v2.setIt(false,[0,1]); a.AddTensorProd(v1,v2,False); b.SetIt(False,[1,2,2,1]); if not (a = b) then raise Exception.Create('Not same'); end;
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!